package net.towee.model.bittorrent;

import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Information about registred torrent
 * @author c58
 */
public interface TorrentData extends IsSerializable  {	
	/**
	 * @return infoHash of this torrent 
	 */
	String getInfoHash();
	
	/**
	 * @return list of peers
	 */
	List<Peer> getPeersList();
	
	/**
	 * Add new peer to list
	 * @param pr
	 * @return true if this peer with unique ID
	 */
	boolean addPeer(Peer pr);
	
	/**
	 * Remove peer from list
	 * @param pr
	 * @return
	 */
	boolean removePeer(String peerId);
	
	/**
	 * @return number of seeders
	 */
	int getSeeders();
	
	/**
	 * @return leechers number
	 */
	int getLeechers();
	
	/**
	 * plus one to seeders number
	 */
	void incSeeders();
	
	/**
	 * minus one to seeders number
	 */
	void decSeeders();

	/** 
	 * @param peer
	 * @return peer if exists or null
	 */
	Peer getPeer(String peerId);
}
